/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.open.api.facade;

import info.peigen.hotpot.common.core.domain.DomainObject;
import info.peigen.hotpot.common.core.util.IdUtil;
import info.peigen.hotpot.component.open.api.facade.enums.ApiStatus;
import jakarta.validation.constraints.NotEmpty;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

/**
 * <b>(Api)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/10/12
 */
@EqualsAndHashCode(callSuper = true)
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class Api extends DomainObject {
    @NotEmpty
    String    gid;
    @Builder.Default
    String    apiLogId = IdUtil.id();
    @NotEmpty
    String    requestNo;
    /** 接口名称 */
    @NotEmpty
    String    apiCode;
    @NotEmpty
    String    partnerId;
    /** 接口状态 */
    @Builder.Default
    ApiStatus status   = ApiStatus.Init;
    /** 加密串 */
    @NotEmpty
    String    encrypt;
    /** 解密串 */
    String decrypt;
    /** 客户浏览器 IP */
    String userIp;
    /** 接口版本 */
    @Builder.Default
    String version = "1.0";
}